package com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.zhinenghuacangku_nanjinglu.R;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.entity.NanJingLu_MeterOutStorageListInfo;

import java.util.List;

//import me.jessyan.armscomponent.commonres.utils.GlideUtil;


public class NanJingLu_DianBiaoChuKuAdapter extends BaseQuickAdapter<NanJingLu_MeterOutStorageListInfo, BaseViewHolder> {

    private Context mContext;
    private INanJingLu_DianBiaoChuKuAdapter mINanJingLu_dianBiaoChuKuAdapter;

    public NanJingLu_DianBiaoChuKuAdapter(Context context, @Nullable List<NanJingLu_MeterOutStorageListInfo> data, INanJingLu_DianBiaoChuKuAdapter iNanJingLu_dianBiaoChuKuAdapter) {
        super(R.layout.item_nan_jing_lu__dian_biao_chu_ku, data);
        this.mContext = context;
        this.mINanJingLu_dianBiaoChuKuAdapter = iNanJingLu_dianBiaoChuKuAdapter;
    }

    @Override
    protected void convert(BaseViewHolder helper, NanJingLu_MeterOutStorageListInfo item) {
        //GlideUtil.loadImage(mContext,item.getImg(),helper.getView(R.id.img_head));
        helper.setText(R.id.tv_name, item.getMaterial() + "--mid=" + item.getMid());
        helper.setText(R.id.tv_spname, "仓位： " + item.getSpacename());
        helper.setOnClickListener(R.id.btn_agv_chu_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mINanJingLu_dianBiaoChuKuAdapter.chuKuAGV(item);
            }
        });
        helper.setOnClickListener(R.id.btn_li_kuchu_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mINanJingLu_dianBiaoChuKuAdapter.chuKuLiKu(item);

            }
        });

    }

    public interface INanJingLu_DianBiaoChuKuAdapter {
        void chuKuAGV(NanJingLu_MeterOutStorageListInfo item);

        void chuKuLiKu(NanJingLu_MeterOutStorageListInfo item);

    }

}
